package cn.edu.scau.cmi.ema.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {

	public static void main(String[] args) throws Throwable {
		
		
		Calendar da = CmiTimeUtil.castZxlDateString2Calendar("38820");
		System.out.println("张星联日期的年月日分别是：" + da.get(Calendar.YEAR) + da.get(Calendar.MONTH) + da.get(Calendar.DAY_OF_MONTH));
		
		
		
		
		
		
		
		String oriangeProducedate = "购进日期：2020年10月10日" ;
//		oriangeProducedate = oriangeProducedate.replaceAll("[^x00-xff[-/ ]]", "").trim();
		System.out.println(oriangeProducedate);
		
		
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
		Date df = dateFormat.parse("2012-12-30");
//		Date df = dateFormat.parse(oriangeProducedate);
		
		
		String year = oriangeProducedate.substring(0, 4);
		String month = oriangeProducedate.substring(4, 6);
		String day = oriangeProducedate.substring(6, 8);
		
		String pattern = "\\d{5}.\\d";
		boolean test = Pattern.matches(pattern , "12345.6");
		
		
		System.out.println("tets");
		
		
		String[] divisionDateStrings = new String[5];
		int index = 0;
//		截取数字
		Pattern pat = Pattern.compile("(\\d+)");
		Matcher matcher = pat.matcher(oriangeProducedate);
		while(matcher.find()) {
			divisionDateStrings[index] = new String(matcher.group(0));
			index++;
		}
		System.out.println(Arrays.toString(divisionDateStrings));
		
		
		
		
		
	}

}
